export function pay(data){
    return new Promise(function(resolve,reject){
        wx.requestPayment({
            'appId': data.appId,
            'timeStamp': data.timeStamp,
            'nonceStr': data.nonceStr,
            'package': data.package,
            'signType': 'MD5',
            'paySign': data.paySign,
            'success': function (res) {
                console.log(res)
                wx.showToast({
                    title: "支付成功",
                    icon: 'success',
                    duration: 2000,
                    success:res=>{
                        resolve(res.data)
                    }
                })
            },
            fail: function () {
                reject("支付失败")
            }
        })
    })
 }
 export default {
     pay
 }
   